tuple1 = (1,2,3,4,5,"hello world",3.14,True)
# 索引
print(tuple1[1])

# 切片
print(tuple1[::-1])

# len
print(len(tuple1))

tuple2 = (1,2,3,4,5)
print(max(tuple2))
print(min(tuple2))

# del
# del tuple2
# print(tuple2)

# 相加
print(tuple1 + tuple2)

# 相乘
print(tuple2 * 3)

# in
print(1 in tuple2)

# 修改元组中的元素
# tuple2[1] = 4
# print(tuple2) # 报错

# 元组的常用方法

# 统计包含指定元素的个数
a =  tuple1.count(2)
print("a----->",a)

# 返回指定元素的索引位
b =  tuple1.index(3)
print("b----->",b)

print("🍎" * 20)

# 元组的遍历
for i in tuple1:
    print("i----->",i)

for index,value in enumerate(tuple1):
    print("index----->",index,"value----->",value)

for i in range(len(tuple1)):
    print("i----->", i)
